﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Configuration;
namespace XiaoYuStock.AppService.Storage
{
   public   class StorageFactory
    {
       public static IStorage GetInstance()
       {
           string storage = typeof(StorageFile).Name;
           if (System.Configuration.ConfigurationManager.AppSettings["Storage"] != null)
           {
               storage = System.Configuration.ConfigurationManager.AppSettings["Storage"];

           }
           switch (storage.ToLower())
           {
               case "storagefile":
               default:
                   return new StorageFile();
               case "storgedatabase":
                   return new StorgeDatabase();
           }
       
       }
    }
}
